1. /* sdcm2pi.cpp by K.Tsuru */
  2. // function ID 3506 DRADIX, constant
  3. /********************************
  4. SDouble class
  5. 2/pi
  6. Used in the reduction of an argument
  7. of trigonometric functions.
  8. *********************************/
  9. #ifndef SN_H
  10. #include "sn.h"
  11. #endif
  12. static SDouble* m2pi = NULL; //keep in the static memory
  13. static uint m2pi_size = 0;
  14. void M2PiFree(){ //free memory of m2pi
  15. if(m2pi_size == 0) return;
  16. delete m2pi; m2pi = NULL; m2pi_size = 0;
  17. }
  18. /* 2/pi */
  19. SDouble M2Pi(){
  20. uint ms = SNManager::SNMaxSize(SNManager::REAL);
  21. if(m2pi_size < ms){
  22. if(m2pi == NULL) m2pi = new SDouble;
  23. SDouble pi2 = MPi2(); // pi/2
  24. *m2pi = DReciprocal(pi2); // 2/pi
  25. m2pi_size = ms;
  26. }
  27. return *m2pi;
  28. }

sdcm2pi.cpp : last modifiled at 2017/06/23 10:17:11(738 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).